import { Controller, Get, Post, Render } from '@nestjs/common'
import { AppService } from './app.service'
import { IsPublic } from './common/decorator/is-public/is-public.decorator'

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}
  @Get()
  @Render('index')
  root() {
    return {
      lang: 'zh-CN',
      title: 'Nestjs',
      message: 'hello word'
    }
  }

  @IsPublic()
  @Get('/category')
  getCategory() {
    return this.appService.getHello()
  }

  @Post('/category')
  setCategory() {
    return this.appService.getHello()
  }
}
